package com.menu.Service;

import com.menu.Pojo.Ingredients;
import com.menu.Pojo.Menu;
import com.menu.Pojo.Step;
import com.menu.Utils.ResponseResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface MenuService {
    /**
     * 添加菜谱功能
     * @param menuSrc
     * @param difficulty
     * @param cookTime
     * @param introduce
     * @param userId
     * @param tips
     * @return
     */
    ResponseResult addMenu(MultipartFile menuSrc, String difficulty, String cookTime, String introduce, Integer userId,
                           String tips,String menuName);


    ResponseResult findMenuByKeyWord(String keyWord,int pageNow,int pageSize);

    /**
     * 遍历所有的食谱+分页
     * @param pageNow
     * @param pageSize
     * @return
     */
    ResponseResult findAllMenu(Integer pageNow,Integer pageSize);

    /**
     * 遍历最近七天的所有食谱
     * @return
     */
    ResponseResult findAllNearTimeMenu(Integer pageNow,Integer pageSize);

    /**
     * 通过id查找菜谱详细信息
     * @param menuId
     * @return
     */
    ResponseResult findMenuById(Integer menuId);

    /**
     * 模糊查询食谱
     * @param key
     * @return
     */
    ResponseResult findMenuByNameLike(String key,Integer pageNow,Integer pageSize);

    /**
     * 精选菜谱
     * @param pageNow
     * @param pageSize
     * @return
     */
    ResponseResult findAllMenuByCollection(Integer pageNow,Integer pageSize);


    /**
     * 模糊查询根据收藏最多遍历
     * @return
     */
    ResponseResult findAllMenuByCollectionNameLike(String menuName,Integer pageNow,Integer pageSize);

    /**
     * 模糊查询根据浏览量最多遍历
     * @param menuName
     * @return
     */
    ResponseResult findAllMenuByDohNameLike(String menuName,Integer pageNow,Integer pageSize);

    /**
     * 添加菜谱步骤
     * @param userId
     * @param menuId
     * @param stepList
     * @return
     */
    ResponseResult addSteps(Integer userId,Integer menuId,List<Step> stepList);

    /**
     * 添加食材用量
     * @param menuId
     * @param ingredientsList
     * @return
     */
    ResponseResult addIngredients(Integer menuId,List<Ingredients> ingredientsList);

    /**
     * 遍历某用户发布的菜谱
     * @param userId
     * @return
     */
    ResponseResult findMenuByUserId(Integer userId,Integer pageNow,Integer pageSize);

    /**
     * 审核菜谱
     * @param menuId
     * @return
     */
    ResponseResult verifyMenu(Integer menuId,Integer state);

    /**
     * 遍历所有食谱的封面
     * @return
     */
    ResponseResult findAllMenuSrc(Integer pageNow,Integer pageSize);

    /**
     * 添加步骤
     * @param userId
     * @param menuId
     * @param stepSrc
     * @return
     */
    ResponseResult addStep(Integer userId,Integer menuId,MultipartFile stepSrc,String content);


    /**
     * 添加食材
     * @param userId
     * @param menuId
     * @param dosage
     * @param ingredientsName
     * @return
     */
    ResponseResult addIngredient(Integer userId,Integer menuId,String dosage,String ingredientsName);

    /**
     * 根据id删除食谱
     * @param menuId
     * @return
     */
    ResponseResult deleteMenu(Integer menuId,Integer userId);

    /**
     * 批量删除食谱
     * @param menuId
     * @return
     */
    ResponseResult batchDeleteMenu(Integer[] menuId,Integer userId);

    /**
     * 管理员后台模糊查询
     * @param key
     * @param pageNow
     * @param pageSize
     * @return
     */
    ResponseResult adminFindMenuByNameLike(String key,Integer pageNow,Integer pageSize);

    /**
     * 删除菜谱封面图片
     * @param menuId
     * @param userId
     * @return
     */
    ResponseResult deleteMenuSrc(Integer menuId,Integer userId);
}
